package com.kingtown.inventory.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import com.kingtown.inventory.MainApplication;
import com.kingtown.inventory.R;
import com.kingtown.inventory.domain.so.AssetSo;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    MainApplication mApplication;
    Context _this;
    private Handler handler = new Handler();
    Button btnInventory, btnAdd, btnOut;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        getSupportActionBar().hide();// 隐藏ActionBar
        _this = this;
        mApplication = (MainApplication) this.getApplication();
        setTitle("首页");

        btnInventory = findViewById(R.id.btn_inventory);
        btnAdd = findViewById(R.id.btn_add);
        btnOut = findViewById(R.id.btn_out);
        btnInventory.setOnClickListener(this);
        btnAdd.setOnClickListener(this);
        btnOut.setOnClickListener(this);
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_inventory -> startActivity(new Intent().setClass(_this, InventoryActivity.class));
            case R.id.btn_add -> startActivity(new Intent().setClass(_this, AddActivity.class));
            case R.id.btn_out -> startActivity(new Intent().setClass(_this, OutActivity.class));

        }
    }
}